﻿using System;
using System.Windows.Data;
using NetBay.Core.BusinessEntities.Workflow;

namespace Rio.Framework.Pages.Helpers.Converter
{
    public class WorkflowStateFinishToBoolean : IValueConverter
    {

        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value != null)
            {
                return ((WorkflowInstance)value).State == WorkflowState.Finished ? true : false;
            }
            return null;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
